"use client";
import { Suspense } from "react";
import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import Link from "next/link";
import { MdLibraryMusic } from "react-icons/md";
import { GameGlobalStyle, GameRoot, GameNavbar, GameContent, BackgroundVideo } from "./page.styles";
import { useGameEngine } from "./hooks/useGameEngine";
import PreGameView from "./components/PreGameView";
import PlayingView from "./components/PlayingView";
import ResultsView from "./components/ResultsView";
function GameInner() {
const engine = useGameEngine();
const {
// refs
audioRef, videoRef, charRowRef, charRefs,
// song
audioUrl, songTitle, songArtist, isVideo, isReady, loadingLrc,
// phase
phase, countdown,
// game state
g, gameLines, accuracy, wpm,
// timing
currentMs, duration, progressPct, lineTimingPct, lineRemainingMs,
currentLineTime, intermissionData,
// display
wrongChar, clearShowing, comboAnimKey, wrapSpaceIndicators,
// settings
backgroundOpacity, setBackgroundOpacity, audioVolume, setAudioVolume,
isPreviewPlaying,
// handlers
handleStart, handleRestart, handlePreviewToggle,
} = engine;
return (
{!isVideo && (
)}
{isVideo && (
)}
TypingMIXX
Home
{phase === "idle" && (
)}
{(phase === "countdown" || phase === "playing") && (
)}
{phase === "finished" && (
)}
);
}
export default function GamePage() {
return (
<>
Loading...
}
>
>
);
}